<extend name="Public:base" />
<block name="content">
	<form id="validation-form" method="post">
    <style type="text/css">
        li{
            list-style: none;;
        }
		table{
			text-align: center;
		}
		.mytableer tbody > tr > td{
			border: none;
		}
    </style>
<div class="table-responsive">
	<table class="table table-striped table-bordered table-hover search-form" id="nav-table">
		<thead>
	    <th>提交时间：<input id="startDate" name="start_time" value="{:I('start_time')}" class="Wdate" type="text" onfocus="WdatePicker({dateFmt:'yyyy-M-d 00:00:00'})"/>- <input id="endDate" name="end_time" value="{:I('end_time')}" class="Wdate" type="text" onfocus="WdatePicker({dateFmt:'yyyy-M-d 00:00:00'})"/>

	    姓名：<input name="name" type="text" placeholder="" value="{:I('name')}" style="width:90px;" />

	    手机号：<input name="phone" type="text" placeholder="" value="{:I('phone')}" style="width:90px;" />
		身份证号码：<input name="num" type="text" placeholder="" value="{:I('num')}" style="width:160px;" />
				<a class="btn btn-primary btn-sm radius5" href="javascript:;" id="search" url="{:U('Master/index')}">查询</a>
			</th>
		</thead>
	</table>
</div>
</form>
<div class="table-responsive">
	<table class="table table-striped table-bordered table-hover"  id="mytable">
		<thead>
			<tr>
				<th align="center">序号</th>
				<th align="center">姓名</th>
				<th align="center">账号</th>
				<th align="center">身份证</th>
				<th align="center">手持证照</th>
				<th align="center">身份证正面照</th>
				<th align="center">身份证背面照</th>
				<th align="center">提交时间</th>
				<th >操作</th>
			</tr>
		</thead>
		<tbody>
				<volist name="user" id="vo" key="k">
				<tr>
					<td>{$k}</td>
					<td align="left">{$vo.id_name}</td>
					<td align="left">{$vo.phone}</td>
					<td align="left">{$vo.id_num}</td>
					<td align="left"><img src="{$vo.pic_hold}" style="width: 120px;height: 80px"/></td>
					<td align="left"><img src="{$vo.pic_psitive}" style="width: 120px;height: 80px"/></td>
					<td align="left"><img src="{$vo.pic_other_side}" style="width: 120px;height: 80px"/></td>
					<td align="left">{$vo.add_time}</td>
					<td>
						<table class="mytableer">
							<tr>
								<td>
									<a href="" class="btn btn-xs btn-info radius5" onclick='passStatus("{$vo.user_id}",1)'>通过</a>
								</td>
								<td>
									<a href="{:U('Master/why')}/user_id/{$vo.user_id}" class="btn btn-xs btn-info radius5">不通过</a>
								</td>
							</tr>
						</table>
					</td>
					</tr>
				</volist>
				<tr>
					<td colspan="20" class="page">{$page}</td>
				</tr>
		</tbody>
	</table>
</div>
</block>
<block name="javascript">
<script>
$(function() {

	$("#search").click(function () {
		var url = $(this).attr('url');
		var query = $('.search-form').find('input,select').serialize();
		query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
		query = query.replace(/^&/g, '');
		if (url.indexOf('?') > 0) {
			url += '&' + query;
		} else {
			url += '?' + query;
		}
		window.location.href = url;
	});

});

function passStatus($user_id,$status){
	$.ajax({
		url:"{:U('Master/passStatus')}",
		type:"post",
		data:{user_id:$user_id,status:$status},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}

function lock($user_id){
	$.ajax({
		url:"{:U('User/lock')}",
		type:"post",
		data:{worker_user_id:$user_id},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}

function addblack($user_id){
	$.ajax({
		url:"{:U('User/blacklist')}",
		type:"post",
		data:{worker_user_id:$user_id},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}

function restorelock($user_id){
	$.ajax({
		url:"{:U('User/lock')}",
		type:"post",
		data:{worker_user_id:$user_id,
			  restore:1},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}

function restoreblack($user_id){
	$.ajax({
		url:"{:U('User/blacklist')}",
		type:"post",
		data:{worker_user_id:$user_id,
			restore:1},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}

function addblock($user_id){
	$.ajax({
		url:"{:U('User/lock')}",
		type:"post",
		data:{worker_user_id:$user_id},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}

function cancelblack($user_id){
	$.ajax({
		url:"{:U('User/blacklist')}",
		type:"post",
		data:{worker_user_id:$user_id,
			restore:1},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}

function cancellock($user_id){
	$.ajax({
		url:"{:U('User/lock')}",
		type:"post",
		data:{worker_user_id:$user_id,
			restore:1},
		success:function(data){
			if(data=='1'){
				$.jbox.tip("正在修改数据...", 'loading');
				// 模拟2秒后完成操作
				window.setTimeout(function () { $.jbox.tip('修改成功！', 'success');location.reload()}, 1000);
			}else{
				$.jbox.info("修改失败!",'提示');
			}
		}
	});
}
</script>
</block>